package com.beyondsoft.sabg.edu.model.db;

import com.beyondsoft.sabg.edu.model.db.core.BasicEntity;
import com.beyondsoft.sabg.edu.model.db.core.UserAccount;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.Set;

/**
 * @Author Mo cr
 * @Date 2023/8/4
 */
@Entity
@Data
@EqualsAndHashCode(callSuper = true)
@Table(name = "nothing-studentInfo")

public class StudentInfo extends BasicEntity {
    @Column(unique = true)
    private String studentNumber;
    @JsonIgnore
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private UserAccount userAccount;
    @Size(max = 30)
    private String studentName;
    @Size(max = 5)
    private String studentGender;
    private String studentBirthday;
    //政治面貌
    @Size(max = 30)
    private String studentPoliticalFace;
    @Size(max = 30)
    private String studentNation;
    private Long collegeID; //管理单位代码
    //管理单位(从拉取数据代码来看，逻辑：如果管理单位代码为空则取全校人员二级单位代码)，此字段备用
    private String departmentName;
    @Size(max = 30)
    // 学院
    private String studentCollege;
    @Size(max = 15)
    private String studentProfessionId;
    @Size(max = 30)
    private String studentProfession;
    private String studentScore;
    private String studentRank;
    @Size(max = 10)
    private String studentPoor;
    //弃用  用studentTelephone
    @Size(max = 11)
    private String studentPhone;
    @Size(max = 30)
    // 学历
    private String studentEducation;
    @Size(max = 30)
    // 年级
    private String studentGrade;
    @Size(max = 30)
    // 学习方式（全日制，非全日制）
    private String studentStudyType;
    @Size(max = 30)
    // 培养方式（定向，非定向）
    private String studentCultivationMode;
    @Size(max = 50)
    // 学生标签：001正式学籍002弹性学制0033+X学制005其他006进修代培生007硕博连读008留学生
    private String studentTags;
    @Size(max = 30)
    private String studentStatus;
    @Size(max = 5)
    private String studentInSchool;
    // 联系电话
    @Size(max = 20)
    private String studentTelephone;
    //专项计划
    @Size(max = 50)
    private String studentPlan;
    @Size(max = 100)
    //家庭所在地(详细到村或者社区)
    private String studentHomeLocation;
    @ManyToMany(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER)
    @JoinColumn(name = "teacher_id")
//    @JsonIgnore
    private Set<TeacherInfo> teacherInfos;

    //困难标签（普通困难，特别困难）
    private String tag;

    //籍贯
    private String studentNativePlace;
    //身份证
    private String idCard;
    // 更新学生基本信息的时间
    private LocalDateTime lastUpdateTime;

}
